package com.feishi.core.analytic.element;


import com.feishi.core.analytic.PoType;

import java.nio.charset.Charset;

import static java.nio.charset.StandardCharsets.*;

/**
 * Created by caixq on 5/4 004.
 */
public class AnalyticStaticStartDataElement extends AnalyticStaticDataElement {
    private byte[] value;



    public byte[] getValue() {
        return value;
    }

    public AnalyticStaticStartDataElement(byte[] value) {
        this.value = value;
        init();
    }

    private void init() {
        this.length=value.length;
        this.type= PoType.ELEMENT_START;
    }

    public AnalyticStaticStartDataElement(byte b) {
        this.value = new byte[]{b};
        init();
    }
    public AnalyticStaticStartDataElement(String value) {
        this.value =value.getBytes(UTF_8) ;
        init();
    }
    public AnalyticStaticStartDataElement(String value, Charset charset) {
        this.value =value.getBytes(charset) ;
        init();
    }

}
